package com.lxy.web;

import com.lxy.exception.MyException;
import com.lxy.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import springfox.documentation.annotations.ApiIgnore;

@ApiIgnore
@Controller
public class TestController {

    @Autowired
    private TestService testService;

    @RequestMapping("/hello")
    @ResponseBody
    public String test() {
        return "test";
    }

    @RequestMapping("/test")
    public String index(ModelMap map) {
        map.addAttribute("host", "http://blog.didispace.com");
        return "/index";
    }

    @RequestMapping("/e")
    public String e() throws MyException{
        throw  new MyException("出错!");
    }




}
